# @Time : 2022/7/29 16:34
# @Author : zhangzhihui
# @Email : mrzhangzh@gmail.com
from django import forms
from django.forms import widgets
from DjangoUeditor.forms import UEditorField
from forum.models import Category


class ContentForm(forms.Form):
    # category = forms.IntegerField(label="分类", widget=widgets.Select())
    content_html = UEditorField("", height=550, width='100%', toolbars='full', imagePath='app/images/')

    def __init__(self, *args, **kwargs):
        super(ContentForm, self).__init__(*args, **kwargs)
        # self.fields["category"].widget.choices = Category.objects.values_list("id", "name")